package com.meisiabc.app.task;

import com.meisiabc.app.service.SmsPushService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/***
 * @Author: jiyang
 * @Date: 2018-12-20 15:22
 */
@Slf4j
@Component
public class SmsPushTask {

    @Autowired
    private SmsPushService smsPushService;

    @Scheduled(cron = "0 0 */1 * * ?")
//    @Scheduled(cron = "0 */1 *  * * ?")
    public void classBeginNoticeTask() {
        log.info("上课时间提醒-公众号推送-开始");
        smsPushService.classReminderPush();
        log.info("上课时间提醒-公众号推送-结束");
    }

    @Scheduled(cron = "0 */10 *  * * ?")
//    @Scheduled(cron = "0 */1 *  * * ?")
    public void teacherLeaveNoticeTask() {
        log.info("外教请假消息推送-开始");
        smsPushService.teacherLeaveSendNotice();
        log.info("外教请假消息推送-结束");
    }


}
